package javabase.classloader;

import java.util.Date;

public class ClassLoaderTest {
	
	
	public static void main(String[] args) {
		System.out.println(ClassLoaderTest.class.getClassLoader().getClass().getName());
		

//		System.out.println(System.class.getClassLoader().getClass().getName());
		
		ClassLoader loader = ClassLoaderTest.class.getClassLoader();
		
		while (loader != null) {
			System.out.println(loader.getClass().getName());
			loader = loader.getParent();
		}
		
		
		//System.out.println(new Bean(1L, "dek")) ;
		
		try {
			Class clazz = new MyClassLoader(".").loadClass("Bean");
			
			Date date = (Date) clazz.newInstance();
			
			System.out.println(date);
			
		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	
}
